<template>
	<view class="wrap">
		<u-waterfall v-model="skuList">
			<template v-slot:left="{leftList}">
				<view class="demo-warter" v-for="(item, index) in leftList" :key="index" @click="seeImg(item.image)">
					<!-- 警告：微信小程序中需要hx2.8.11版本才支持在template中结合其他组件，比如下方的lazy-load组件 -->
					<u-lazy-load threshold="0" border-radius="10" :image="item.imgUrl" :index="index"></u-lazy-load>
					<view class="demo-title">
						{{item.skuName}}
					</view>
					<view class="demo-tag">
						<view class="demo-tag-owner">
							包邮
						</view>

						<view class="demo-tag-text">
							{{item.skuType}} 人想要
						</view>
					</view>
					<view class="demo-shop" style="display: flex;justify-content: flex-start;align-items: center;">
						<img :src="item.photoUrl" alt="" style="width: 20px;height: 20px;border-radius: 20px;">
						<p style="margin-left: 5px;">{{item.nickName}} </p>
					</view>
					<!-- <u-icon name="close-circle-fill" color="#fa3534" size="34" class="u-close" @click="remove(item.id)"></u-icon> -->
				</view>
			</template>
			<template v-slot:right="{rightList}">
				<view class="demo-warter" v-for="(item, index) in rightList" :key="index" @click="seeImg(item.image)">
					<u-lazy-load threshold="0" border-radius="10" :image="item.imgUrl" :index="index"></u-lazy-load>
					<view class="demo-title">
						{{item.skuName}}
					</view>
					<view class="demo-tag">
						<view class="demo-tag-owner">
							包邮
						</view>
						<view class="demo-tag-text">
							{{item.skuType}} 人想要
						</view>
					</view>

					<view class="demo-shop" style="display: flex;justify-content: flex-start;align-items: center;">
						<img :src="item.photoUrl" alt="" style="width: 20px;height: 20px;border-radius: 20px;">
						<p style="margin-left: 5px;">{{item.nickName}} </p>
					</view>
					<!-- <u-icon name="close-circle-fill" color="#fa3534" size="34" class="u-close" @click="remove(item.id)"></u-icon> -->
				</view>
			</template>
		</u-waterfall>
		<u-loadmore bg-color="rgb(240, 240, 240)" :status="loadStatus" @loadmore="addRandomData"></u-loadmore>
	</view>
</template>

<script>
	import {
		mapMutations
	} from 'vuex';

	export default {
		data() {
			return {
				
			}
		},
		props: {
			skuList: {
				type: Array,
				default: []
			},
		},
		mounted() {
		},

		methods: {
	
		},
		
	
	}
</script>

<style>
	/* page不能写带scope的style标签中，否则无效 */
	page {
		background-color: rgb(240, 240, 240);
	}
</style>

<style lang="scss" scoped>
	.demo-warter {
		border-radius: 8px;
		margin: 10px 5px;
		background-color: #ffffff;
		padding: 8px;
		position: relative;
	}

	.u-close {
		position: absolute;
		top: 32rpx;
		right: 32rpx;
	}

	.demo-image {
		width: 100%;
		border-radius: 4px;
	}

	.demo-title {
		font-size: 30rpx;
		margin-top: 5px;
		color: $u-main-color;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		/* 显示的行数 */
		-webkit-box-orient: vertical;
		overflow: hidden;


	}

	.demo-tag {
		display: flex;
		margin-top: 5px;
	}

	.demo-tag-owner {
		background-color: $u-type-primary;
		color: #FFFFFF;
		display: flex;
		align-items: center;
		padding: 4rpx 14rpx;
		border-radius: 50rpx;
		font-size: 20rpx;
		line-height: 1;
	}

	.demo-tag-text {
		border: 1px solid $u-type-primary;
		color: $u-type-primary;
		margin-left: 10px;
		border-radius: 50rpx;
		line-height: 1;
		padding: 4rpx 14rpx;
		display: flex;
		align-items: center;
		border-radius: 50rpx;
		font-size: 20rpx;
	}

	.demo-shop {
		font-size: 22rpx;
		color: $u-tips-color;
		margin-top: 5px;
	}
</style>